﻿using System;
using KillBill.Presentation.Common.WindowsForms.View;
using KillBill.Presentation.Modules.Administration.IView;
using KillBill.Presentation.Modules.Administration.Presenter;
using KillBill.Presentation.Modules.Clients.View;


namespace KillBill.Presentation.Modules.Administration.View
{
    public partial class AdminTagView : KillBillWinFormView, IAdminTag
    {
        public AdminTagView()
        {
            InitializeComponent();
            Presenter = new AdminTagPresenter(this);

        }
        public AdminTagPresenter Presenter { get; set; }

        private void AdminTagView_Load(object sender, System.EventArgs e)
        {
            var nodoc = treeView1.Nodes.Add("Clientes");
            nodoc.Nodes.Add("Agregar cliente");
            nodoc.Nodes.Add("Borrar cliente");
            nodoc.Nodes.Add("Modificar cliente");
            nodoc.Nodes.Add("Buscar cliente");

            var nodop = treeView1.Nodes.Add("Productos");
            nodop.Nodes.Add("Agregar producto");
            nodop.Nodes.Add("Borrar producto");
            nodop.Nodes.Add("Modificar producto");
            nodop.Nodes.Add("Buscar producto");

            var nodosa = treeView1.Nodes.Add("Ventas");
            nodosa.Nodes.Add("Nueva Venta ");
            nodosa.Nodes.Add("Borrar Venta");
            nodosa.Nodes.Add("Modificar");
            
            var nodosu = treeView1.Nodes.Add("Proveedores");
            nodosu.Nodes.Add("Agregar proveedor");
            nodosu.Nodes.Add("Borrar Proveedores");
            nodosu.Nodes.Add("Modificar Proveedores");
            nodosu.Nodes.Add("Buscar Proveedor");
            treeView1.ExpandAll();
        }

        private void TreeView1AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            string nodo = treeView1.SelectedNode.Text;
            switch (nodo)
            {

                case "Agregar cliente":
                    var fac = new AddClientView {MdiParent = this.MdiParent};
                    fac.Show();
                    break;
                case "Editar cliente":
                    var fec = new CustomerEditView { MdiParent = this.MdiParent };
                    fec.Show();
                    break;
                case "Buscar cliente":
                    var fbc = new CustomerFindView { MdiParent = this.MdiParent };
                    fbc.Show();
                    break;
                //case "Agregar proveedor":
                //    var fap = new ProviderAddView { MdiParent = this.MdiParent };
                //    fap.Show();
                //    break;
                default:
                    Console.WriteLine(@"Default case");
                    break;
            }

        }

    }
}
        
  